package com.asset.dispoal.formula.service;

import com.asset.dispoal.formula.api.IGbFormulaService;
import com.asset.dispoal.formula.dto.GbFormulaRequest;
import com.asset.dispoal.formula.dto.GbFormulaResponse;
import com.asset.dispoal.formula.service.commom.DeleteGbFormulaCommand;
import com.asset.dispoal.formula.service.commom.InsertGbFormulaCommand;
import com.asset.dispoal.formula.service.commom.QueryPageFormulaCommand;
import com.asset.dispoal.formula.service.commom.UpdateGbFormulaCommand;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tech.mhuang.pacebox.springboot.protocol.Result;
import tech.mhuang.pacebox.springboot.protocol.data.PageVO;

/**
 * 服务实现类
 *
 * @author: mhuang
 * @date: 2022-02-17 13:09:09
 */
@Service
public class GbFormulaServiceImpl implements IGbFormulaService {

    @Autowired
    DeleteGbFormulaCommand deleteGbFormulaCommand;

    @Autowired
    UpdateGbFormulaCommand updateGbFormulaCommand;

    @Autowired
    InsertGbFormulaCommand insertGbFormulaCommand;

    @Autowired
    QueryPageFormulaCommand queryPageFormulaCommand;


    @Override
    public Result<PageVO<GbFormulaResponse>> page(GbFormulaRequest gbFormulaRequest) {
        final Result<PageVO<GbFormulaResponse>> execute = queryPageFormulaCommand.execute(gbFormulaRequest);
        return execute;
    }

    @Override
    public Result insert(GbFormulaRequest gbFormulaRequest) {
        return insertGbFormulaCommand.execute(gbFormulaRequest);

    }

    @Override
    public Result update(GbFormulaRequest GbFormulaRequest) {
        return updateGbFormulaCommand.execute(GbFormulaRequest);
    }

    @Override
    public Result delete(String id) {
        return deleteGbFormulaCommand.execute(id);
    }

    @Override
    public Result getById(String id) {
        return null;
    }
}